package com.lc.guessTheWords.scene;

import android.view.KeyEvent;

import com.lc.guessTheWords.MainActivity;
import com.lc.guessTheWords.layer.MainLayer;
import com.wiyun.engine.nodes.Scene;

/**
 * 主菜单场景
 * 
 * @author Administrator
 * 
 */
public class MainScene extends Scene {

	private static MainScene instance = null;
	private static Object sync_obj = new Object();

	MainLayer mainLayer;

	protected MainScene() {
		mainLayer = new MainLayer();
		mainLayer.setTouchEnabled(true);
		addChild(mainLayer);
	}

	public static MainScene make() {
		synchronized (sync_obj) {
			if (instance == null) {
				instance = new MainScene();
			}
			return instance;
		}
	}

	@Override
	public boolean wyKeyDown(KeyEvent event) {

		if (event.getKeyCode() == KeyEvent.KEYCODE_BACK) {
			MainActivity.instance.showExitTips();
			return true;
		}
		return super.wyKeyDown(event);
	}

}
